-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding failing tests for end event firing multiple times when copying a file more than once. #402
Conversation
After more debugging, I think this is an issue with node's event emitter. I was able to whittle this down to a pretty small reproducible case. var emitter = Object.create(require('events').EventEmitter.prototype);
emitter.once('e', function () {
emitter.emit('e');
console.log('Should be called once (emit)');
});
emitter.once('e', function () {
console.log('Should be called once.');
});
emitter.emit('e'); |
Coverage remained the same when pulling 86385e4fa71b0d04fabaea4a3e13080be5bc6588 on timrwood:single-end into c57e4e1 on yeoman:master. |
I filed an issue with node (nodejs/node-v0.x-archive#6503) regarding the event emitter bug, but in the meantime, 86385e4 should work as a stopgap until that fix gets resolved in node. |
@@ -501,6 +501,38 @@ describe('Environment', function () { | |||
// actual run | |||
.run('angular:all myapp'); | |||
}); | |||
|
|||
it('should only call the end event once', function (done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note about the current bug so anyone looking at this test case know where it come from. Maybe just in the doc string adding (bug #402)
Also, remove the "should" from the doc string.
LGTM, thanks for digging this bug. Can you checkout the comments I left and squash these two commits together? |
Addressed your comments and rebased the commits. |
Adding failing tests for end event firing multiple times when copying a file more than once.
Awesome thanks! |
Here is a failing test illustrating the issue in #302.
I think this is related to using the filename as part of the event name when added to the conflicter and resolving the conflict.